On a modern Web site there is often a need to present information in more than one language. Such Web sites often tends to be problematic to build and maintain, but in Content Studio there is a unique feature available for all of its users. Content Studio has a very powerful engine for the administration of multi language documents or even on entire Web sites.

The functionality is called MLC which stands for "Multi Language Clustering" and enables the site editors and authors to create and maintain versions of the same document in many languages. Once the web site is set up and configured, the MLC engine will automatically maintain the relation between these document versions.

On the Web site, Content Studio is aware of the language of the user's Web browser and automatically redirects the visitor to the version written in the preferred language, provided that it exists, of course. For example, if a visitor navigates to the English version of an article and the she prefers Swedish, Content Studio automatically displays the document in Swedish if it exists, otherwise the English version is displayed.

Content Studio supports all forms of text encoding and uses by default Unicode (UTF-8) for storage. Each language that is handled can have its own encoding standard. The support is only limited to what the server environment can handle.

The MLC technology can be used to build large multi language web sites and a good example is the The International Library in Stockholm that has its entire content written in English, Swedish, Spanish, Russian, Chinese, Farsi, Arabic and French.

The MLC technology does not have to be implemented on the whole web site. It can be applied to only a group of documents that is considered relevant, and can also be applied on EPT documents.
MLC is best suited to information that needs to be published in more than one language and has a clear structure. The developer can use one of the MLC aware AS-components that makes it easy to develop the Web site without any programming.

When to use MLC

Even though it is possible to build an entire Web site based on the MLC technology this can make the Web site more difficult to maintain and make it more restricted for the future. Remember that a different language often also represents another country and there might be a need for separate sections on the Web site for each country. For this reason a good multi language Web site needs carefully planning and a very worked through structure. All types of document can be MLC:ed but content document types such as EPT documents and standard HTML-documents are natural candidates. For example, often a Web site has a one or more headers and footers that are included on every page. These are very good candidates for MLC, you simply insert, most preferably, the MLC master versions of the footer and header documents by using the "Insert document by MLC language" component and Content Studio ensures that the correct versions are displayed to the visitor.

If you have a few languages and there is not likely that you will add more languages in the future you also can MLC your presentation and editing templates as well. Since the MLC:ed EPT documents are siblings they must share the same schema which means that you must use the same schema for each template. This can be a rather clumsy solution and if you need to add more languages later you might need to use some sort of labeling technique. This labeling can be implemented as EPT documents that are MLC:ed as well. For each user you the read the labels when the user selects the language or enters the Web site and use some caching mechanism to store the labels so they can easily be inserted when needed. The labels can be stored in an Xml document in the user's Session and inserted programmatically or with a custom labeling component or control.

Setting up MLC

An MLC consist of a number of connected documents. However, the MLC information is set on the category level. This means that all documents within a category have its corresponding MLC document in another category. The settings for the MLC are found in the MLC tab of the category properties. The category can be the master of a MLC or a member of an existing MLC. For each category, a specific language should be selected. The language of the master category will be the default language for the MLC.

When you create an MLC you first create a number of categories that are of the same type. It is wise to structure these in an intuitive way so that is clear that these categories belong to each other. You can name these categories with the languages they represent as the sample image below shows. If your language aware documents are EPT documents they must share the same schema, thus having the same field names. You can either let all of the categories share the same Edit template or create an MLC structure of your Edit templates as well. In the former case you might need to provide language aware labeling of the text in the template something that is not needed in case you choose the later method. However making the Edit templates MLC:ed will render several templates with the same field definitions differing only by their labels a text, making it a lot more complicated to update the templates later or add more languages later. The following sample shows three MLC:ed categories with a Swedish master and two members in British English and Norwegian named after their languages.

A sample MLC category structure
A sample MLC category structure

After you have created the information structure you must create the MLC master category. The master category contains all the master documents that act as master for all the language aware documents that should be synchronized with each other. The MLC master is created from the Category property dialog in the MLC tab. When you click the Properties button located under the MLC-tab for the category to become the new MLC master MLC, you will see the following dialog that ask whether the category should be a member in an existing MLC or form a new independent MLC.

The new MLC confirm dialog
The new MLC confirm dialog

When you accept to create a new MLC you will be presented with a dialog that lets you select the language to use for the new MLC master. After that you have selected the language to use, the MLC tab in the category property dialog will indicate that the category in question is an MLC enabled category. You can see the language in use and whether the category is master in the MLC.

MLC information in the category property dialog
MLC information in the category property dialog

After that the MLC master has been created you are ready to promote the rest of the categories in your structure to members in the newly created MLC. Fire up the property dialog of the affected category and repeat the same process as when you created the master but this time you select that the category should be a member in an existing MLC rather that being a new MLC. In this case you will see a dialog that contains a list of all the MLC master categories on the web site with their languages and whether they have member categories or not.
Select the MLC that this category should belong to and press OK. Before returning to the category property dialog you again will be presented with the dialog where you can select the language of the category. The select language must be unique within the MLC selected.

The MLC list dialog
The MLC list dialog

Once the MLC is created you can start creating documents. The preferred way of working is to create a document in the master category and then create the sibling documents in the member categories afterwards. To make this process simpler the Webitor is MLC aware so that the author very easily can navigate to another language without any need to close the Webitor - the sibling version of the document is just reloaded in place of the original document. If the document has not yet been created in the member language, Content Studio asks the user if a new connected document should be created and whether the original content should be copied into the new document. In this way the person that translates the document can see the original content while working on the translated text. In the image below a new master document has been created and the author can see what other language version of this document that exists. Here, all of the other languages appear "greyed out" indicating that versions of the document in these other languages yet not have been created.

The MLC language selector in the Webbitor
The MLC language selector in the Webbitor

Information structure for MLC

It can be rather difficult to introduce MLC connections once the site information structure is established. MLC aspects should be a part of the information structure planning. With an unsuitable information structure, it becomes difficult to maintain the MLC definitions. For more information, read the chapter Information Structure (IFS).

The common practice is to establish parallel structures for the different languages. All documents belonging to the same language, and only documents in that language, will be within the same category substructure. When adding a new MLC language, all you need to do is to create a new language category and make the category a member of the existing MLC. Now, new content documents can be created for the new language and connected to the suitable existing master document.

There is not necessary that all documents exists as connected documents in all of the MLC member categories - it is perfectly legal to create document that is targeted only for readers of a certain language. But, as a general rule it is better to always create the master document first and then the member documents afterwards. Unfortunately, it is not possible to connect member documents to each other without an existing master document and for that reason when a master document is deleted all connection between the connected member documents are lost as well.

For the developer: Language connections

The query string element LANG can be used to find alternative language versions of specific documents. Each MLC has a default language that is used whenever there is no available document for the requested language. Assuming that the document 3000 holds the Swedish version of a text, the query string below could be used to find (or display) the English version of the same document (in document 4711).

...default.aspx?id=3000&lang=en-gb

The corresponding functionality is available via the site API class (with the subsequent XML data).

C#
//Get the English version of document with id 3000
ContentStudio.Document.MLC.MLCDocument mlcd = new ContentStudio.Document.MLC.MLCDocument();
string XmlReturnCode = mlcd.GetDocumentFromLanguage(CS_ConnectionId, 
                                                    CS_UserSessionId, 
                                                    3000, 
                                                    "en-gb", 
                                                    0);
VB.NET
'Get the English version of document with id 3000
Dim mlcd As New new ContentStudio.Document.MLC.MLCDocument()
Dim XmlReturnCode As String = mlcd.GetDocumentFromLanguage(CS_ConnectionId, _
                                                           CS_UserSessionId, _
                                                           3000, _
                                                           "en-gb", _
                                                           0)

The returned Xml will look like the following sample

Xml
<root>
   <status>0</status>
   <statustext>Success</statustext>
   <doc documentid="4711" categoryid="1234" />
</root>

As an alternative you can use the high level GetMLCSiblingInformation static method of the MLCInformation class which provides a more object oriented way of doing the same thing. This method returns an MLCSiblingInformation object that contains basic information about the found sibling document. By using this method you do not need to parse the returned Xml.

C#
//Get the English version of document with id 3000
ContentStudio.MLC.MLCSiblingInformation info = 
     ContentStudio.MLC.MLCInformation.GetMLCSiblingInformation(CS_ConnectionId, 
                                                               CS_UserSessionId, 
                                                               3000, 
                                                               "en-gb");
Response.Write(String.Format("Document id {0} in Category id {1}", info.DocumentID, info.CategoryID));
VB.NET
'Get the English version of document with id 3000
Dim info As ContentStudio.MLC.MLCSiblingInformation = _
     ContentStudio.MLC.MLCInformation.GetMLCSiblingInformation(CS_ConnectionId, _
                                                               CS_UserSessionId, _
                                                               3000, _
                                                               "en-gb")
Response.Write(String.Format("Document id {0} in Category id {1}", info.DocumentID, info.CategoryID))

One language is used as the master language within the MLC. Content Studio uses, by default, the master language document identities together with language specifiers to identify the effective documents (as described above).

In the following example, the documents also have included documents. A document (1456) with the master language (A) includes another document (1354) using the component Insert document by MLC Language" in its EPT. In another language (B), the document 2071 is supposed to include document 2056. They are within a MLC, where documents 1456 and 2071 are siblings and documents 1354 and 2056 also are siblings. When regarding document 2071 (language B) in the user interface, it would seem that document 1354 (language A) is included. But when calling document 2071, document 2056 is included because the component includes the corresponding MLC sibling. The following calls would give the same result:

...default.aspx?id=1456&lang=B
...default.aspx?id=2071